Skip to content
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

__get_value function - ast.literal_eval on a str type to get a str type is returning SyntaxError #17

Closed
HenleyKuang opened this issue Jul 23, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Projects

Comments

@HenleyKuang
Copy link

  1. Python version python --version
    3.6.8
  2. Test Junkie version pip show test_junkie
    Name: test-junkie
    Version: 0.7a3
    Summary: Modern Testing Framework
    Home-page: https://www.test-junkie.com/
    Author: Artur Spirin
    Author-email: as.no.replies@gmail.com
    License: UNKNOWN
    Location: c:\serp_storage.venv\lib\site-packages
    Requires: coverage, colorama, configparser, psutil, appdirs, statistics
    Required-by:
  3. Platform aka Windows 10 or Linux Mint 18.1
    Windows 10
  4. Command used, if running via terminal
tj config update -s "C:\serp_storage\tests\test_serp_storage.py" --html_report "C:\serp_storage\report.html"
tj run
  1. Smallest code snippet that can reproduce the issue and /or description of the issue
(.venv) PS C:\serp_storage> tj run
[INFO] Scanning: C:\serp_storage\tests\test_serp_storage.py ...
[INFO] Scan finished in: 0.90 seconds. Found: 1 suite(s).
[INFO] Running tests ...
[ERROR] Unexpected error during test execution.

Traceback (most recent call last):
  File "c:\serp_storage\.venv\lib\site-packages\test_junkie\cli\cli_runner.py", line 271, in run_suites
    quiet=args.quiet)
  File "c:\serp_storage\.venv\lib\site-packages\test_junkie\runner.py", line 131, in run
    self.__settings = Settings(runner_kwargs=self.__kwargs, run_kwargs=kwargs)
  File "c:\serp_storage\.venv\lib\site-packages\test_junkie\settings.py", line 48, in __init__
    self.__print_settings()
  File "c:\serp_storage\.venv\lib\site-packages\test_junkie\settings.py", line 65, in __print_settings
    value=self.html_report, type=type(self.html_report)))
  File "c:\serp_storage\.venv\lib\site-packages\test_junkie\settings.py", line 192, in html_report
    key="html_report", default=Settings.__DEFAULT_HTML)
  File "c:\serp_storage\.venv\lib\site-packages\test_junkie\settings.py", line 99, in __get_value
    value = ast.literal_eval(value)
  File "C:\Users\hkuang\AppData\Local\Programs\Python\Python36\lib\ast.py", line 48, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "C:\Users\hkuang\AppData\Local\Programs\Python\Python36\lib\ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 1
    C:\serp_storage\report.html
     ^
SyntaxError: invalid syntax

value = C:\serp_storage\report.html
type(value) = <class 'str'>

Expected behaviour

Actual behaviour


If attaching logs, make sure to remove any personal information, credentials, tokens, keys - anything that you don't
want to become public.

@HenleyKuang HenleyKuang changed the title __get_value function - ast.literal_eval on a string type is returning SyntaxError __get_value function - ast.literal_eval on a str type to get a str type is returning SyntaxError Jul 23, 2019
@ArturSpirin ArturSpirin self-assigned this Jul 23, 2019
@ArturSpirin ArturSpirin added the bug Something isn't working label Jul 23, 2019
@ArturSpirin ArturSpirin added this to To do in Bugs Jul 23, 2019
@ArturSpirin ArturSpirin moved this from To do to In progress in Bugs Jul 23, 2019
@ArturSpirin
Copy link
Owner

@HenleyKuang Fix will be available in version 0.7a4

@ArturSpirin ArturSpirin moved this from In progress to Done in Bugs Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Bugs
  
Done
Development

No branches or pull requests

2 participants