-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to pytest and support PY3 syntax on tests
- Loading branch information
Showing
6 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
This file contains tests that use PY3 syntax and would break the parser | ||
if loaded with PY2. | ||
Make sure the test runner doesn't collect this file automatically and that | ||
the symbols in this module are not shadowed by the ones in the main test file. | ||
:copyright: (c) 2013 by Telefonica I+D. | ||
:license: see LICENSE for more details. | ||
""" | ||
|
||
import unittest | ||
from pyshould import should | ||
|
||
from di import injector, Key | ||
|
||
KeyA = Key('A') | ||
KeyB = Key('B') | ||
KeyC = Key('C') | ||
|
||
|
||
def test_py3_kwonly(): | ||
|
||
inject = injector({KeyA: 'A', KeyB: 'B', KeyC: 'C'}) | ||
|
||
# While we don't fix the inject decorator we'll receive an error | ||
with should.throw(ValueError): | ||
@inject | ||
def foo(a, b=KeyB, *args, c=KeyC): | ||
pass | ||
|
||
|