File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ import py
2
+
3
+
4
+ def test_fixture_graph_created (testdir ):
5
+ """Check that --show-fixture-duplicates will give us list of duplicates."""
6
+ sub1 = testdir .mkpydir ("sub1" )
7
+ sub2 = testdir .mkpydir ("sub1/sub2" )
8
+ sub1 .join ("conftest.py" ).write (py .code .Source ("""
9
+ import pytest
10
+
11
+ @pytest.fixture
12
+ def arg1(request):
13
+ pass
14
+ """ ))
15
+ sub2 .join ("conftest.py" ).write (py .code .Source ("""
16
+ import pytest
17
+
18
+ @pytest.fixture
19
+ def arg1(request):
20
+ pass
21
+ """ ))
22
+ sub1 .join ("test_in_sub1.py" ).write ("def test_1(arg1): pass" )
23
+ sub2 .join ("test_in_sub2.py" ).write ("def test_2(arg1): pass" )
24
+
25
+ result = testdir .runpytest_subprocess ('--fixture-graph' , '-s' )
26
+
27
+ result .stdout .fnmatch_lines ("created at artifacts/fixture-graph-sub1-test_in_sub1.py__test_1.dot." )
28
+ result .stdout .fnmatch_lines ("You can convert it to a PNG using 'dot -Tpng artifacts/fixture-graph-sub1"
29
+ "-test_in_sub1.py__test_1.dot -o artifacts/fixture-graph-sub1-test_in_sub1"
30
+ ".py__test_1.png'" )
31
+
32
+ result .stdout .fnmatch_lines ("created at artifacts/fixture-graph-sub1-sub2-test_in_sub2.py__test_2.dot." )
33
+ result .stdout .fnmatch_lines ("You can convert it to a PNG using 'dot -Tpng artifacts/fixture-graph-sub1"
34
+ "-sub2-test_in_sub2.py__test_2.dot -o artifacts/fixture-graph-sub1-sub2-te"
35
+ "st_in_sub2.py__test_2.png'" )
You can’t perform that action at this time.
0 commit comments