-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix union use in utils.py & add tox GitHub workflow (#35)
* Add specific Python version classifers * Add tox workflow, single test, and fix union usage Resolves: #32 * Update minor version & add instructions to docs
- Loading branch information
1 parent
b6cb1a6
commit 20c5d58
Showing
7 changed files
with
233 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: tox | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Run Tests | ||
run: tox run -m ${{ matrix.python-version }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import subprocess | ||
|
||
|
||
def test_cli_should_return_help_string_when_passed_no_args(): | ||
"""Tests that running edgar-tool without any arguments returns the CLI's help string and 0 exit code.""" | ||
# GIVEN | ||
expected = """ | ||
NAME | ||
edgar-tool | ||
SYNOPSIS | ||
edgar-tool COMMAND | ||
COMMANDS | ||
COMMAND is one of the following: | ||
rss | ||
Fetch the latest RSS feed data for the given company tickers and save it to either a CSV, JSON, or JSONLines file. | ||
text_search | ||
Perform a custom text search on the SEC EDGAR website and save the results to either a CSV, JSON, or JSONLines file. | ||
""" | ||
|
||
# WHEN | ||
result = subprocess.run(["edgar-tool"], capture_output=True, text=True) | ||
|
||
# THEN | ||
assert result.returncode == 0 | ||
assert result.stdout.strip() == expected.strip() |
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,14 @@ | ||
[tox] | ||
envlist = py39, py310, py311, py312 | ||
labels = | ||
; Used to map GitHub workflow python version to tox env | ||
3.9 = py39 | ||
3.10 = py310 | ||
3.11 = py311 | ||
3.12 = py312 | ||
|
||
[testenv] | ||
deps = | ||
pytest>=8 | ||
commands = | ||
pytest tests/ --import-mode=importlib |