Skip to content

Commit 9919035

Browse files
committed
print_error: improve coverage
Replicates graphql/graphql-js@84b416f
1 parent 046fee5 commit 9919035

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a query language for APIs created by Facebook.
1313
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
1414

1515
The current version 1.0.5 of GraphQL-core-next is up-to-date with GraphQL.js version
16-
14.3.1. All parts of the API are covered by an extensive test suite of currently 1877
16+
14.3.1. All parts of the API are covered by an extensive test suite of currently 1879
1717
unit tests.
1818

1919

tests/error/test_print_error.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77

88
def describe_print_error():
9+
def prints_an_error_without_location():
10+
error = GraphQLError("Error without location")
11+
assert print_error(error) == "Error without location"
12+
13+
def prints_an_error_using_node_without_location():
14+
error = GraphQLError(
15+
"Error attached to node without location",
16+
parse("{ foo }", no_location=True),
17+
)
18+
assert print_error(error) == "Error attached to node without location"
919

1020
# noinspection PyArgumentEqualDefault
1121
def prints_line_numbers_with_correct_padding():

0 commit comments

Comments
 (0)