Commit graph

300 commits

Author SHA1 Message Date
Noorhteen Raja NJ
38295a1dd9
Remove globals (#4280)
* refactor: remove usage of global variables in abbrevs.py

* chore: add flake8-mutable to prevent mutable defaults

* fix: abbrevs expand test

* refactor: add xonsh session singleton

* refactor: fix circular errors when using xonshSession as singleton

* refactor: remove black magicked builtin attributes

* style: black format tests as well

* refactor: update tests to use xonsh-session singleton

* refactor: update abbrevs to not use builtins

* test: remove DummyCommandsCache and patch orig class

* fix: failing test_command_completers

* test: use monkeypatch to update xession fixture

* fix: failing test_pipelines

* fix: failing test_main

* chore: run test suit as single invocation

* test: fix tests/test_xonsh.xsh

* refactor: remove builtins from docs/conf.py

* fix: mypy error in jobs

* fix: test error from test_main

* test: close xession error in test_command_completers

* chore: use pytest-cov for reporting coverage

this will include subprocess calls, and will increase coverage

* style:
2021-05-20 13:14:26 +03:00
Daniel Shimon
27db574d99
Fix annotated assignment (#4278)
* ast: Fix annotated assignment

* ast: Support annotated variable without a value

* tests: Test annotated assign statements

* news: Add annotated-assignment
2021-05-12 12:39:11 -04:00
Noorhteen Raja NJ
c2d5e60799
Py39 support (#4101)
* fix: handle ast.Index and ast.ExtSlice change while Parsing

related to #4100, #4099, #4068, #4038, #4028, #4005,

* fix: py39 raises when lineno & col not given

TypeError: required field "col_offset" missing from keyword

* fix: tuple inside scbscriptor support for py39

* chore: enable py39 ci checks

they were silently failing before

* test: a backlog test for attributes inside subscriptors

this would require debugging deep into the ply parser methods.

* docs: add news item

* test: skip test_rc_with_modified_path on windows

* Update tests/test_parser.py

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

* test: mark failing tests for py39 parser

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2021-02-17 12:31:33 -05:00
Anthony Scopatz
8fada74d64 get_repo_url() test 2020-10-13 16:33:53 -05:00
David Strobach
6461d9ec73 Add subproc from envvar test 2020-09-16 14:56:45 +02:00
David Strobach
607d649497 Fix environment variable assignment grammar ambiguity 2020-09-16 14:41:38 +02:00
David Strobach
76cd2ea43e Add test for leading variable initialization 2020-09-04 21:55:12 +02:00
David Strobach
f9f485f25d Add tests for args non-default following default 2020-08-28 17:55:05 +02:00
David Strobach
2eb5271fa0 Add PEP 570 pos-only parameters to lambda varargs 2020-08-27 03:28:44 +02:00
David Strobach
79eccc488c Fix pos-only parameters not requiring comma before slash
This fixes `def foo(x /, y):` being accepted as valid syntax.
2020-08-27 03:28:44 +02:00
David Strobach
b5575947ad Fix positional-only args test 2020-08-27 03:28:44 +02:00
David Strobach
af9c5b59bd Add support for PEP 570 positional-only arguments 2020-08-27 03:28:37 +02:00
David Strobach
5d64139b8f Add support for Python 3.8 star expressions in yield statement 2020-08-26 20:37:19 +02:00
David Strobach
fb664b3456 Fix starred return test 2020-08-26 20:32:53 +02:00
David Strobach
c9d45de556 Add support for Python 3.8 star expressions in return statement 2020-08-26 19:14:45 +02:00
Anthony Scopatz
f048b295d6 black updates to tests and docs 2020-08-26 10:10:59 -05:00
David Strobach
b0336dfbe5 Fix list comprehensions with multiple if clauses 2020-08-25 01:34:59 +02:00
David Strobach
5edd851feb Fix literal whitespace being deleted from f-strings
Fixes an issue with
 f"$HOME       = {$HOME}"
resulting in
 "$HOME= /home/foobar"
2020-08-20 05:41:28 +02:00
David Strobach
c3a354781b Finalize f-string handler transition
- Moves the f-string handler into a separate FStringAdaptor class.
- Removes helper dictionary mapping int ID to f-string field.
  The f-string fields are now rather patched early directly into the
  AST as an argument to eval_fstring_field. This solves the problems
  with f-string fields lifespan management.
2020-08-17 13:41:11 +02:00
David Strobach
9879fce927 Support Python 3.8 self-documenting f-string expressions 2020-08-17 04:57:39 +02:00
David Strobach
12c8990e53 Fix f-string tests 2020-08-17 04:57:39 +02:00
David Strobach
40436e3a97 Add walrus tests 2020-08-11 18:26:40 +02:00
Matthias Bussonnier
784c5286ef
Remove most of Python 3.5 compatibility code. (#3654)
There  now should not be any remaining  3,5 conditinal code.
We now directly use inspect's getouterframes, so remove it from
inspector

The 3.5 parser get merged into 3.6 and a number of global vaiable
referring to 3.5/3.6 are now gone.

The only remaining mention is appveyor test, which are anyway failing
but not being seen as so by GitHub, so I'll leave them alone.
2020-08-05 10:29:31 -04:00
Bob Hyman
dd82c5ffd8 Clean up ignorable warnings in clean pytest run 2020-05-08 15:41:06 -04:00
Bob Hyman
26475146e2
Flake8 1 (#3550)
* flake8 fixes -- tests only

* fix ci failure

* integrate fix from is_3551 so tests will pass.

* Update tests/test_builtins.py

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2020-05-05 06:42:28 -04:00
David Strobach
940713f7f8 Add @$() tests 2020-04-08 18:34:47 +02:00
Gil Forsyth
3b011dcfd1
Merge pull request #3107 from laloch/noexpand-raw-string
Do not attempt to expand raw strings in subprocess mode
2019-05-15 15:11:49 -04:00
Anthony Scopatz
f1127ed916 Revert "updated setup.py for Python 3.4 (revert of 91ec14bb6d)"
This reverts commit 002a317951.
2019-05-14 17:41:35 -04:00
Anthony Scopatz
002a317951 updated setup.py for Python 3.4 (revert of 91ec14bb6d) 2019-05-14 17:32:31 -04:00
David Strobach
450a25f4b0 Test parsing of raw string literals in subprocess mode 2019-05-09 19:34:30 +02:00
Rodrigo Oliveira
91ec14bb6d Drop support for Python 3.4
Minimal required Python version is now 3.5.
2019-05-06 16:51:32 -03:00
Gil Forsyth
8a3c8a6832 Add tests for parser and lexer for pf-strings 2018-12-25 17:40:04 -05:00
Anthony Scopatz
41aa65ac1d make AnnAssign Py 3.6+ 2018-11-02 19:18:37 -04:00
Anthony Scopatz
dc1f02c232 added prelim support for annotation assignement 2018-11-02 19:12:06 -04:00
David Strobach
352d105095 test_parser: test import group statement 2018-11-02 20:39:51 +01:00
Anthony Scopatz
c31c35dca1 black 2018-10-20 14:12:09 -06:00
Anthony Scopatz
c48d5308e0 fixed up fstring parsing 2018-10-20 14:07:18 -06:00
Anthony Scopatz
4b5236da04 escape sequence fixes 2018-10-01 23:01:00 -04:00
David Dotson
6d288dd184 Updated tests 2018-09-29 18:57:01 -07:00
David Dotson
1c8144b354 Merge branch 'master' into xonsh_session
Hoping I didn't introduce a regression into `built_ins.py`...
2018-09-29 17:33:26 -07:00
Anthony Scopatz
814826da13 black 2018-09-22 10:36:45 -04:00
Anthony Scopatz
4456f3e6fa fixed some corner cases and added tests 2018-09-22 09:54:21 -04:00
Anthony Scopatz
0219bac2c8 Perform environment variable substitution in f-strings 2018-09-20 18:58:02 -04:00
Anthony Scopatz
f0c3a4b1cd more tests, news and docs 2018-09-17 18:23:20 -04:00
Anthony Scopatz
9c2a756b68 preliminary working version 2018-09-17 17:52:40 -04:00
Anthony Scopatz
4c91df2abc many test fixes 2018-09-13 14:03:35 -04:00
Anthony Scopatz
634a8ec9f2 black tests 2018-08-30 09:18:49 -05:00
Anthony Scopatz
3f9bfed62c Fixed def spam(*): pass issue 2017-12-06 22:12:50 -05:00
Gordon Ball
bd2bcdc291 Skip parser tests if python < 3.6 2017-10-09 13:36:34 +00:00
Gordon Ball
d45daf97e4 Test numeric underscores in parser, lexer 2017-10-09 13:13:28 +00:00