diff --git a/test/units/utils/amazon_placebo_fixtures.py b/test/units/utils/amazon_placebo_fixtures.py index 5c49845817e..000cca1b40e 100644 --- a/test/units/utils/amazon_placebo_fixtures.py +++ b/test/units/utils/amazon_placebo_fixtures.py @@ -61,12 +61,16 @@ def placeboify(request, monkeypatch): # remove the test_ prefix from the function & file name ).replace('test_', '') - try: - # make sure the directory for placebo test recordings is available - os.makedirs(recordings_path) - except OSError as e: - if e.errno != errno.EEXIST: - raise + if not os.getenv('PLACEBO_RECORD'): + if not os.path.isdir(recordings_path): + raise NotImplementedError('Missing Placebo recordings in directory: %s' % recordings_path) + else: + try: + # make sure the directory for placebo test recordings is available + os.makedirs(recordings_path) + except OSError as e: + if e.errno != errno.EEXIST: + raise pill = placebo.attach(session, data_path=recordings_path) if os.getenv('PLACEBO_RECORD'):