Browse Source

chore: update tests (#607)

pull/608/head
Pier CeccoPierangioliEugenio 2 weeks ago committed by GitHub
parent
commit
ec15da97b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      .github/workflows/testing.yml
  2. 2
      Makefile
  3. 15
      apps/ttkode/tests/conftest.py
  4. 2
      docs/requirements.txt

1
.github/workflows/testing.yml

@ -74,6 +74,7 @@ jobs:
run: |
DDDD=$(pwd)
pytest ${DDDD}/tests/pytest
pytest ${DDDD}/apps
- name: Dumb Smoke Test
run: |

2
Makefile

@ -137,7 +137,7 @@ test: .venv
. .venv/bin/activate ; \
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .venv,build,tmp,experiments ;
. .venv/bin/activate ; \
pytest tests/pytest
pytest tests/pytest apps
mkdir -p tmp
wget -O tmp/test.input.001.bin https://github.com/ceccopierangiolieugenio/binaryRepo/raw/master/pyTermTk/tests/test.input.001.bin
wget -O tmp/test.input.002.bin https://github.com/ceccopierangiolieugenio/binaryRepo/raw/master/pyTermTk/tests/test.input.002.bin

15
apps/ttkode/tests/conftest.py

@ -30,6 +30,21 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../../libs/pyTerm
# Add the ttkode package path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
# Reuse the pytest mocks used by the core test suite
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../../tests/pytest'))
from mock_term import Mock_TTkTerm
from mock_input import Mock_TTkInput
moduleTerm = type(sys)('TermTk.TTkCore.drivers.term_unix_common')
moduleTerm._TTkTerm = Mock_TTkTerm
moduleInput = type(sys)('TermTk.TTkCore.TTkTerm.input')
moduleInput.TTkInput = Mock_TTkInput
sys.modules['TermTk.TTkCore.drivers.term_unix_common'] = moduleTerm
sys.modules['TermTk.TTkCore.TTkTerm.input'] = moduleInput
@pytest.fixture(autouse=True)
def reset_plugin_instances():
"""Reset plugin instances before each test to avoid state leakage."""

2
docs/requirements.txt

@ -5,7 +5,7 @@ backports.tarfile==1.2.0
beautifulsoup4==4.13.4
build==1.2.2.post1
certifi==2025.4.26
cffi==1.17.1
cffi
charset-normalizer==3.4.2
cryptography==46.0.5
css-html-js-minify==2.5.5

Loading…
Cancel
Save