1717 if not test_data_path .exists ():
1818 test_data_path = None
1919
20+
2021# Create fixture to auto cleanup tmp directory after tests
2122@pytest .fixture (scope = "session" , autouse = True )
2223def tmp_dir_cleanup ():
@@ -61,11 +62,11 @@ def test_help():
6162 pytest .param (f"""{ executable } -l User - "{ test_data_path / 'users.json' } " """ , id = "list2" , ** mark_test_data ),
6263 pytest .param (f"""{ executable } -m Photos "{ test_data_path / 'photos.json' } " """ , id = "model1" , ** mark_test_data ),
6364
64- pytest .param (f"""{ executable } -l Photo items "{ test_data_path / 'photos.json' } "
65+ pytest .param (f"""{ executable } -l Photo items "{ test_data_path / 'photos.json' } " \
6566 -m Photos "{ test_data_path / 'photos.json' } " """ ,
6667 id = "list1_model1" , ** mark_test_data ),
6768
68- pytest .param (f"""{ executable } -l Photo items "{ test_data_path / 'photos.json' } "
69+ pytest .param (f"""{ executable } -l Photo items "{ test_data_path / 'photos.json' } " \
6970 -l User - "{ test_data_path / 'users.json' } " """ ,
7071 id = "list1_list2" , ** mark_test_data ),
7172
@@ -80,6 +81,7 @@ def test_help():
8081
8182@pytest .mark .parametrize ("command" , test_commands )
8283def test_script (command ):
84+ command = command .replace ("\n " , " " )
8385 proc = subprocess .Popen (shlex .split (command ), shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
8486 stdout , stderr = proc .communicate ()
8587 assert not stderr , stderr
@@ -116,7 +118,7 @@ def test_script_custom(command):
116118
117119
118120wrong_arguments_commands = [
119- pytest .param (f"""{ executable } -l Model items "{ test_data_path / 'photos.json' } "
121+ pytest .param (f"""{ executable } -l Model items "{ test_data_path / 'photos.json' } " \
120122 -l Model - "{ test_data_path / 'users.json' } " """ , id = "duplicate_name" ),
121123 pytest .param (f"""{ executable } -l Model items "{ test_data_path / 'photos.json' } " --merge unknown""" ,
122124 id = "wrong_merge_policy" ),
0 commit comments