-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect % formatting and directives for bytes and bytearray
Proposed in #35. Ref: https://www.python.org/dev/peps/pep-0461/
- Loading branch information
Showing
5 changed files
with
121 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from .testutils import VerminTest, detect, current_version | ||
|
||
class VerminBytesDirectiveTests(VerminTest): | ||
def test_b_directive(self): | ||
if current_version() >= 3.5: | ||
self.assertOnlyIn((3, 5), detect("b'%b' % 10")) | ||
|
||
def test_a_directive(self): | ||
if current_version() >= 3.5: | ||
self.assertOnlyIn((3, 5), detect("b'%a' % 'x'")) | ||
|
||
def test_r_directive(self): | ||
v = current_version() | ||
if v < 3 or v >= 3.5: | ||
self.assertOnlyIn(((2, 7), (3, 5)), detect("b'%r' % 'x'")) |
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