-
Notifications
You must be signed in to change notification settings - Fork 2
Write the output of make-[tables|generators] to a file #48
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
Conversation
c4144fd to
011b855
Compare
db914d1 to
eb95448
Compare
And correct some docstrings.
And correct some docstrings.
f0f828b to
b1ce6e8
Compare
Change import_module so that it imports files from the cwd Error if any file we try to write already exists
b1ce6e8 to
f15f673
Compare
mhauru
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor request and one general comment, good otherwise
| run_psql("dst.dump") | ||
|
|
||
| def test_workflow(self) -> None: | ||
| os.chdir("tests/workspace") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to use a tmp_path pytest fixture for this, to use a temporary folder that shouldn't conflict with anything existing, but pytest fixtures don't play nicely with unittest.TestCase subclasses. (https://docs.pytest.org/en/6.2.x/unittest.html)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think there must be a nicer way to do this than chdir() in the test functions / in the setUp. I could imagine the current way might cause some interdependence between tests if one fails in the setup before the first chdir().
18e6b65 to
d648f99
Compare
* sampled and suppressed choice generators * Fixed problems found trying this out for real. --------- Co-authored-by: Tim Band <t.b@ucl>
We currently write the output of the
make-commands to stdout but this doesn't work so well now that we also write other files (e.g. vocab.csvfiles during make-generators and, potentially,stats.yaml).This is a big single commit where we:
--ssg-file=myfilename.py, etc.sys.exit(1)if an ORM, SSG or vocab file we are trying to write already exists (up for debate)main.pyormake.py, which lead to some funny behaviour. We now require the file to be in the current working dir, which necessitated several test changes.tests/tmptotests/workspaceand run our functional tests there.with patch("") as mock_somethingcontext managers for@patch("")test function decorators for better readability (and quicker to create/delete patch calls this way).For the reviewer: