unit test

This commit is contained in:
Erick Friis
2023-12-14 16:23:14 -08:00
parent 32418be48e
commit b515d81b7e
3 changed files with 3 additions and 27 deletions

View File

@@ -55,12 +55,14 @@ jobs:
secrets: inherit
dependencies:
if: ${{ ! startsWith(inputs.working-directory, 'templates/') }}
uses: ./.github/workflows/_dependencies.yml
with:
working-directory: ${{ inputs.working-directory }}
secrets: inherit
extended-tests:
if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') && ! startsWith(inputs.working-directory, 'templates/') }}
runs-on: ubuntu-latest
strategy:
matrix:
@@ -73,7 +75,6 @@ jobs:
defaults:
run:
working-directory: ${{ inputs.working-directory }}
if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') && ! startsWith(inputs.working-directory, 'templates/') }}
steps:
- uses: actions/checkout@v4

View File

@@ -1,22 +0,0 @@
import random
import string
import sys
import traceback
from importlib.machinery import SourceFileLoader
if __name__ == "__main__":
files = sys.argv[1:]
has_failure = False
for file in files:
try:
module_name = "".join(
random.choice(string.ascii_letters) for _ in range(20)
)
SourceFileLoader(module_name, file).load_module()
except Exception:
has_failure = True
print(file)
traceback.print_exc()
print()
sys.exit(1 if has_failure else 0)

View File

@@ -4,7 +4,7 @@
all: help
# Define a variable for the test file path.
TEST_FILE ?= tests/unit_tests/
TEST_FILE ?= tests/
test:
poetry run pytest $(TEST_FILE)
@@ -33,9 +33,6 @@ spell_check:
spell_fix:
poetry run codespell --toml pyproject.toml -w
check_imports: $(shell find pirate_speak -name '*.py')
poetry run python ../../scripts/check_imports.py $^
######################
# HELP
######################