summaryrefslogtreecommitdiff
path: root/tests/functional/s/shallow_copy_environ.py
blob: ee931d71a3497a50244ab22bff8c2e3d43f7529b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Tests for shallow-copy-environ"""
# pylint: disable=wrong-import-position, reimported, ungrouped-imports, import-error, wrong-import-order

import copy
import os

copy.copy(os.environ)  # [shallow-copy-environ]

# Copying a dictionary is okay
test_dict = {}
copy.copy(test_dict)

# Test with renaming the functions
from copy import copy as test_cp
import os as o

test_cp(o.environ)  # [shallow-copy-environ]

# Regression test for non inferable objects
import copy
from missing_library import MissingObject

copy.copy(MissingObject)

# Deepcopy is okay
import copy
import os

copy.deepcopy(os.environ)