-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from kobotoolbox/53-kobo-coding-style
KoBo coding style compliance
- Loading branch information
Showing
19 changed files
with
2,907 additions
and
2,286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# coding: utf-8 | ||
import os | ||
import pytest | ||
|
||
# Python retro compatibility | ||
try: | ||
FileNotFoundError | ||
except NameError: | ||
FileNotFoundError = OSError | ||
|
||
|
||
def clean_up(): | ||
""" | ||
Removes files created by tests | ||
""" | ||
files = ['.uniqid', | ||
'upsert_db_users'] | ||
for file_ in files: | ||
try: | ||
os.remove(os.path.join('/tmp', file_)) | ||
except FileNotFoundError: | ||
pass | ||
|
||
|
||
@pytest.fixture(scope="session", autouse=True) | ||
def setup(request): | ||
# Clean up before tests begin in case of orphan files. | ||
clean_up() | ||
request.addfinalizer(_tear_down) | ||
|
||
|
||
def _tear_down(): | ||
clean_up() | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.