Add acceptance test for new --pyargs behavior.
This commit is contained in:
		
							parent
							
								
									0e05a4fbcf
								
							
						
					
					
						commit
						25711a0879
					
				|  | @ -374,6 +374,17 @@ class TestInvocationVariants: | ||||||
|         out, err = capsys.readouterr() |         out, err = capsys.readouterr() | ||||||
|         assert "--myopt" in out |         assert "--myopt" in out | ||||||
| 
 | 
 | ||||||
|  |     def test_pyargs_importerror(self, testdir, monkeypatch): | ||||||
|  |         monkeypatch.delenv('PYTHONDONTWRITEBYTECODE', False) | ||||||
|  |         path = testdir.mkpydir("tpkg") | ||||||
|  |         path.join("test_hello.py").write('raise ImportError') | ||||||
|  | 
 | ||||||
|  |         result = testdir.runpytest("--pyargs", "tpkg.test_hello") | ||||||
|  |         assert result.ret != 0 | ||||||
|  |         result.stdout.fnmatch_lines([ | ||||||
|  |             "*collected 0 items*" | ||||||
|  |         ]) | ||||||
|  | 
 | ||||||
|     def test_cmdline_python_package(self, testdir, monkeypatch): |     def test_cmdline_python_package(self, testdir, monkeypatch): | ||||||
|         monkeypatch.delenv('PYTHONDONTWRITEBYTECODE', False) |         monkeypatch.delenv('PYTHONDONTWRITEBYTECODE', False) | ||||||
|         path = testdir.mkpydir("tpkg") |         path = testdir.mkpydir("tpkg") | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue