Skip to content

Commit

Permalink
Wipe generated after each testing session
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanistheone committed Feb 7, 2020
1 parent 3936180 commit 3c12f63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -52,11 +52,11 @@ clean-test: ## remove test and coverage artifacts
lint: ## check style with flake8
flake8 ricecooker tests

test: ## run tests quickly with the default Python
test: clean-test ## run tests quickly with the default Python
pytest


test-all: ## run tests on every Python version with tox
test-all: clean-test ## run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
Expand Down
15 changes: 15 additions & 0 deletions tests/conftest.py
@@ -1,4 +1,5 @@
import copy
import glob
import os
import pytest
import requests
Expand All @@ -14,6 +15,18 @@



# GLOBAL TEST SETUP/TEARDOWN UTILS
################################################################################

def pytest_sessionfinish(session, exitstatus):
"""
Cleanup testcontent/generated/ directory after each test run is finished.
"""
generated_path = os.path.join("tests", "testcontent", "generated")
for path in glob.glob(generated_path + os.path.sep + '*'):
os.remove(path)


# CHANNEL FIXTURES
################################################################################

Expand Down Expand Up @@ -662,3 +675,5 @@ def download_fixture_file(source_url, local_path):
f.write(chunk)
f.flush()
f.close()


0 comments on commit 3c12f63

Please sign in to comment.