@@ -559,7 +559,10 @@ def join_pythonpath(what):
559
559
])
560
560
561
561
def test_cmdline_python_namespace_package (self , testdir , monkeypatch ):
562
- monkeypatch .delenv ('PYTHONDONTWRITEBYTECODE' , False )
562
+ """
563
+ test --pyargs option with namespace packages (#1567)
564
+ """
565
+ monkeypatch .delenv ('PYTHONDONTWRITEBYTECODE' , raising = False )
563
566
564
567
search_path = []
565
568
for dirname in "hello" , "world" :
@@ -599,16 +602,21 @@ def join_pythonpath(*dirs):
599
602
monkeypatch .syspath_prepend (p )
600
603
601
604
# mixed module and filenames:
602
- result = testdir .runpytest ("--pyargs" , "ns_pkg.hello" , "world/ns_pkg" )
605
+ result = testdir .runpytest ("--pyargs" , "-v" , " ns_pkg.hello" , "world/ns_pkg" )
603
606
assert result .ret == 0
604
607
result .stdout .fnmatch_lines ([
608
+ "*test_hello.py::test_hello*PASSED" ,
609
+ "*test_hello.py::test_other*PASSED" ,
610
+ "*test_world.py::test_world*PASSED" ,
611
+ "*test_world.py::test_other*PASSED" ,
605
612
"*4 passed*"
606
613
])
607
614
608
615
# specify tests within a module
609
- result = testdir .runpytest ("--pyargs" , "ns_pkg.world.test_world::test_other" )
616
+ result = testdir .runpytest ("--pyargs" , "-v" , " ns_pkg.world.test_world::test_other" )
610
617
assert result .ret == 0
611
618
result .stdout .fnmatch_lines ([
619
+ "*test_world.py::test_other*PASSED" ,
612
620
"*1 passed*"
613
621
])
614
622
0 commit comments