def test_str_args_deprecated(tmpdir, testdir):
 from _pytest.main import EXIT_NOTESTSCOLLECTED
 warnings = []
 class Collect:
  def pytest_logwarning(self, message):
   warnings.append(message)
 ret = pytest.main(('%s -x' % tmpdir), plugins=[Collect()])
 testdir.delete_loaded_modules()
 msg = 'passing a string to pytest.main() is deprecated, pass a list of arguments instead.'
 assert (msg in warnings)
 assert (ret == EXIT_NOTESTSCOLLECTED)

def test_str_args_deprecated ( tmpdir , testdir ) : from _pytest . main import EXIT_NOTESTSCOLLECTED warnings = [ ] class Collect : def pytest_logwarning ( self , message ) : warnings . append ( message ) ret = pytest . main ( ( '%s -x' % tmpdir ) , plugins = [ Collect ( ) ] ) testdir . delete_loaded_modules ( ) msg = 'passing a string to pytest.main() is deprecated, pass a list of arguments instead.' assert ( msg in warnings ) assert ( ret == EXIT_NOTESTSCOLLECTED )
deprecate passing strings to pytest .