@@ -81,14 +81,16 @@ def setUpClass(cls):
8181
8282 @classmethod
8383 def create_directory (cls , dir_name ):
84- full_path = os .path .join (cls .temp_dir , dir_name )
85- os .mkdir (full_path )
86- return full_path
84+ return tempfile .mkdtemp (dir = cls .temp_dir , prefix = dir_name )
8785
8886 def assert_path_does_not_exist (self , full_path ):
8987 if os .path .exists (full_path ):
9088 raise AssertionError ('{0} should not exist' .format (full_path ))
9189
90+ def assert_path_exists (self , full_path ):
91+ if not os .path .exists (full_path ):
92+ raise AssertionError ('{0} should exist' .format (full_path ))
93+
9294 def test_that_dist_directory_is_removed_for_sdist (self ):
9395 dist_dir = self .create_directory ('dist-dir' )
9496 run_setup (
@@ -115,3 +117,14 @@ def test_that_multiple_dist_directories_with_be_removed(self):
115117 )
116118 self .assert_path_does_not_exist (sdist_dir )
117119 self .assert_path_does_not_exist (bdist_dir )
120+
121+ def test_that_directories_are_not_removed_without_parameter (self ):
122+ sdist_dir = self .create_directory ('sdist-dir' )
123+ bdist_dir = self .create_directory ('bdist_dumb' )
124+ run_setup (
125+ 'sdist' , '--dist-dir={0}' .format (sdist_dir ),
126+ 'bdist_dumb' , '--dist-dir={0}' .format (bdist_dir ),
127+ 'clean' ,
128+ )
129+ self .assert_path_exists (sdist_dir )
130+ self .assert_path_exists (bdist_dir )
0 commit comments