-
Notifications
You must be signed in to change notification settings - Fork 72
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
Reorganizes tests and adds a few initial tests for the data side #226
Merged
+165
−9
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4537dec
moves wikipron module tests into subdirectory
lfashby d152748
reformating of test_version.py
lfashby 2bf61b1
adds outline of test for data naming conventions, removes nonsense fr…
lfashby 8ce5cd4
basic framework for testing file creation involved in big scrape
lfashby a86bb7d
renamed file naming test and added comments
lfashby 376985c
reorganizes tests directory, adds test for generate_summary.py
lfashby d9c0a50
fix formating in test_version.py
lfashby 60c3641
xMerge branch 'test_summary' into tests
lfashby 0ec4b84
revises and renames file for testing scrape
lfashby 5cd8a7f
fixes pathing issue in init
lfashby f39ae10
adds some typing to new tests
lfashby a1eca94
changes open statements to use proper encoding
lfashby 39c5349
potential solution to circleci module error
lfashby d04777c
approaching a circleci import solution?
lfashby 3fdbafe
updates changelog
lfashby b12f10b
Merge branch 'master' into tests
lfashby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
revises and renames file for testing scrape
commit 0ec4b847c7de5369f51d05516dca6acf727b7586
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 @@ | ||
import os | ||
import shutil | ||
|
||
from contextlib import contextmanager | ||
|
||
_TESTS_DIR = os.path.dirname( | ||
os.path.dirname(os.path.realpath(__file__)) | ||
) | ||
_TSV_PATH = f"{_TESTS_DIR}/tsv" | ||
_PHONES_PATH = f"{_TESTS_DIR}/phones" | ||
|
||
def write_files_dummy_phones_files(key: str, dialect: str): | ||
with open( | ||
f"{_PHONES_PATH}/{key}_{dialect}phonetic.phones", | ||
"w", | ||
) as f1: | ||
f1.write("a") | ||
with open( | ||
f"{_PHONES_PATH}/{key}_{dialect}phonemic.phones", | ||
"w", | ||
) as f2: | ||
f2.write("a") | ||
|
||
|
||
@contextmanager | ||
def handle_dummy_files(phones: bool, key: str, dialect: str): | ||
os.mkdir(_TSV_PATH) | ||
os.mkdir(_PHONES_PATH) | ||
print("IN CONTENXT MAANGER") | ||
if phones: | ||
write_files_dummy_phones_files(key, dialect) | ||
yield _TSV_PATH | ||
shutil.rmtree(_TSV_PATH) | ||
shutil.rmtree(_PHONES_PATH) | ||
kylebgorman marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this just a file moved from a different directory?
Is it common for this sort of thing to go in an
__init__.py
file? It seems like that's usually just reserved for aliasing and imports. One alternative would be to have something called liketest_setup.py
or something in this directory and have__init__.py
pull it in.