Skip to content

Conversation

@Iain-S
Copy link
Collaborator

@Iain-S Iain-S commented Mar 2, 2023

A slight improvement over the previous system since we now save the starting directory in setUp and return to it in tearDown. Previously, we did chdir('../..') in tearDown, which could go wrong if something unexpected happened in setUp or if an extra chdir() was used in the test functions themselves.

Some improvements that could be added here or in a future PR

  • Reduce duplication by moving the examples/ and workspace/ directories to the test utils module and making them Final.
  • run_psql() presumes that it is being called from the repo root directory. This doesn't feel good as it then matters which order you do the setUp calls in. Is there a way we can remove this reliance on the current working directory to run the db setup scripts with psql?

@Iain-S
Copy link
Collaborator Author

Iain-S commented Mar 2, 2023

Update:

  • I have added a commit that changes how run_psql() works slightly. It can now be called from any location and takes a Path to the .dmp file to be run.

@Iain-S Iain-S requested a review from mhauru March 2, 2023 11:06
@mhauru mhauru mentioned this pull request Mar 2, 2023
@mhauru mhauru merged commit bee1f8e into main Mar 2, 2023
@Iain-S Iain-S deleted the test-chdir branch March 2, 2023 16:21
tim-band added a commit to tim-band/sqlsynthgen that referenced this pull request Jun 27, 2025
…e#51)

and --spec=table-column-gen.csv

Co-authored-by: Tim Band <t.b@ucl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants