-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pipes] refactor Pipes tests interface
- Loading branch information
1 parent
62ff166
commit fe9d62a
Showing
8 changed files
with
459 additions
and
77 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
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
Empty file.
7 changes: 7 additions & 0 deletions
7
libraries/pipes/tests/dagster-pipes-tests/tests/data/conftest.py
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,7 @@ | ||
# conftest.py | ||
import pytest | ||
|
||
|
||
def pytest_runtest_call(item): | ||
# This hook is called immediately before the test function is actually run. | ||
pytest.skip("Intentionally skipping test after setup.") |
13 changes: 13 additions & 0 deletions
13
libraries/pipes/tests/dagster-pipes-tests/tests/data/pipes.toml
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,13 @@ | ||
[general] | ||
error_reporting = true | ||
|
||
[message_channel] | ||
s3 = true | ||
databricks = true | ||
|
||
[messages] | ||
log = true | ||
report_custom_message = true | ||
report_asset_materialization = true | ||
report_asset_check = true | ||
log_external_stream = true |
5 changes: 5 additions & 0 deletions
5
libraries/pipes/tests/dagster-pipes-tests/tests/data/suite.py
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,5 @@ | ||
from dagster_pipes_tests import PipesTestSuite | ||
|
||
|
||
class TestingPipesTestSuite(PipesTestSuite): | ||
BASE_ARGS = ["hello", "there"] |
26 changes: 26 additions & 0 deletions
26
libraries/pipes/tests/dagster-pipes-tests/tests/test_collection.py
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,26 @@ | ||
import os | ||
import shutil | ||
import subprocess | ||
|
||
|
||
def test_collection(tmpdir_factory): | ||
current_dir = os.path.dirname(__file__) | ||
workdir = tmpdir_factory.mktemp("test_collection") | ||
|
||
# copy current_dir/data to workdir | ||
|
||
shutil.copytree( | ||
os.path.join(current_dir, "data"), os.path.join(workdir), dirs_exist_ok=True | ||
) | ||
|
||
# rename suite.py to test_suite.py so that pytest can find it | ||
|
||
shutil.move( | ||
os.path.join(workdir, "suite.py"), os.path.join(workdir, "test_suite.py") | ||
) | ||
|
||
# simply run pytest --collect-only from the current directory | ||
# to check that all tests are loaded without errors | ||
|
||
os.chdir(workdir) | ||
subprocess.run(["pytest"], check=True) |
Oops, something went wrong.