Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws unit test utils] only create a recordings directory when the env var is set #45752

Merged
merged 2 commits into from
Sep 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions test/units/utils/amazon_placebo_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down