Add start and exit test

This commit is contained in:
Artem Veremey
2021-04-19 15:55:46 -07:00
parent 1b10ade46f
commit 99bbcb6a31
5 changed files with 27 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ name: Mac OS X Full Clean Build with ML
env:
GTFF_USE_PROMPT_TOOLKIT: false
GTFF_USE_ION: false
GTFF_ENABLE_QUICK_EXIT: true
on:
push:
branches:
@@ -63,3 +64,7 @@ jobs:
- name: Run tests (Bash)
shell: bash -l {0}
run: pytest tests/
- name: Start Terminal and exit
shell: bash -l {0}
run: python terminal.py

View File

@@ -2,6 +2,7 @@ name: Tests
env:
GTFF_USE_PROMPT_TOOLKIT: false
GTFF_USE_ION: false
GTFF_ENABLE_QUICK_EXIT: true
on: [pull_request, push]
jobs:
linting:
@@ -72,6 +73,9 @@ jobs:
run: |
source $VENV
pytest tests/
- name: Start Terminal and exit
run: python terminal.py
tests-python:
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
needs: test
@@ -120,6 +124,9 @@ jobs:
run: |
source $VENV
pytest tests/
- name: Start Terminal and exit
run: python terminal.py
tests-conda:
name: Conda (${{ matrix.python-version }}, ${{ matrix.os }})
needs: test
@@ -187,3 +194,7 @@ jobs:
- name: Run tests (Bash)
shell: bash -l {0}
run: pytest tests/
- name: Start Terminal and exit
shell: bash -l {0}
run: python terminal.py

View File

@@ -2,6 +2,7 @@ name: Windows 10 Full Clean Build with ML
env:
GTFF_USE_PROMPT_TOOLKIT: false
GTFF_USE_ION: false
GTFF_ENABLE_QUICK_EXIT: true
on:
push:
branches:
@@ -72,3 +73,6 @@ jobs:
shell: bash -l {0}
run: pytest tests/
- name: Start Terminal and exit
shell: bash -l {0}
run: python terminal.py

View File

@@ -24,3 +24,6 @@ USE_PLOT_AUTOSCALING = strtobool(os.getenv("GTFF_USE_PLOT_AUTOSCALING", "False")
# Enable thoughts of the day
ENABLE_THOUGHTS_DAY = strtobool(os.getenv("GTFF_ENABLE_THOUGHTS_DAY", "False"))
# Quick exit for testing
ENABLE_QUICK_EXIT = strtobool(os.getenv("GTFF_ENABLE_QUICK_EXIT", "False"))

View File

@@ -115,6 +115,10 @@ def main():
print_help(s_ticker, s_start, s_interval, b_is_stock_market_open())
should_print_help = False
if gtff.ENABLE_QUICK_EXIT:
print("Quick exit enabled")
break
# Get input command from stdin or user
if not parsed_stdin and len(sys.argv) > 1:
as_input = " ".join(sys.argv[1:])