File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,15 @@ def test_that_modifies_env() -> None:
15
15
os.environ[' CUSTOM_ENV' ] = ' 1'
16
16
```
17
17
18
- With ` pytest-modified-env ` plugin installed, this test will fail.
19
- Because it adds ` CUSTOM_ENV ` inside a test and does not clean it up.
18
+ With ` pytest-modified-env ` plugin installed, this test will fail:
20
19
20
+ ```
21
+ ___________________________ test_that_modifies_env ____________________________
22
+ test_that_modifies_env:4: in pytest_runtest_call
23
+ E RuntimeError: os.environ was changed
24
+ ```
25
+
26
+ Because it adds ` CUSTOM_ENV ` inside a test and does not clean it up.
21
27
In theory it can affect other tests and tests should be isolated!
22
28
23
29
Original file line number Diff line number Diff line change @@ -13,16 +13,28 @@ description = "Pytest plugin to fail a test if it leaves modified `os.environ` a
13
13
version = " 0.1.0"
14
14
license = " MIT"
15
15
16
- authors = []
16
+ authors = [
17
+ " Nikita Sobolev <[email protected] >"
18
+ ]
17
19
18
20
readme = " README.md"
19
21
20
22
repository = " https://github.com/wemake-services/pytest-modified-env"
21
23
22
- keywords = []
24
+ keywords = [
25
+ " pytest" ,
26
+ " pytest-plugin" ,
27
+ " os.environ" ,
28
+ " testing" ,
29
+ " unittest" ,
30
+ " tests" ,
31
+ " test" ,
32
+ " unit tests" ,
33
+ " code quality" ,
34
+ ]
23
35
24
36
classifiers = [
25
- " Development Status :: 3 - Alpha " ,
37
+ " Development Status :: 4 - Beta " ,
26
38
" Intended Audience :: Developers" ,
27
39
" Operating System :: OS Independent" ,
28
40
" Topic :: Software Development :: Libraries :: Python Modules" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def test_allowed() -> None:
23
23
os .environ ['MARKER_ENV' ] = '1'
24
24
25
25
26
- @ pytest . mark . xfail ( reason = 'Env is modified' )
26
+
27
27
def test_expected_to_fail () -> None :
28
28
"""
29
29
This test modifies the env.
You can’t perform that action at this time.
0 commit comments