mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 09:36:44 +03:00
Fix tests (#1119)
* Fix tests * Add extra folders to make test command * Update snapshots * Add python 3.8 to test matrix * Add black command to makefile and black dependency to setup.py * Add lint command * Run format * Remove 3.8 from test matrix * Add Python 3.8 to test matrix * Update setup.py
This commit is contained in:
parent
81d61f82c5
commit
bd6d8d086d
|
@ -4,6 +4,7 @@ dist: xenial
|
|||
python:
|
||||
- "3.6"
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
|
||||
install:
|
||||
- pip install tox tox-travis
|
||||
|
|
12
Makefile
12
Makefile
|
@ -5,10 +5,10 @@ help:
|
|||
|
||||
.PHONY: install-dev ## Install development dependencies
|
||||
install-dev:
|
||||
pip install -e ".[test]"
|
||||
pip install -e ".[dev]"
|
||||
|
||||
test:
|
||||
py.test graphene
|
||||
py.test graphene examples tests_asyncio
|
||||
|
||||
.PHONY: docs ## Generate docs
|
||||
docs: install-dev
|
||||
|
@ -17,3 +17,11 @@ docs: install-dev
|
|||
.PHONY: docs-live ## Generate docs with live reloading
|
||||
docs-live: install-dev
|
||||
cd docs && make install && make livehtml
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
black graphene examples setup.py tests_asyncio
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
flake8 graphene examples setup.py tests_asyncio
|
||||
|
|
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from snapshottest import Snapshot
|
||||
|
||||
|
||||
snapshots = Snapshot()
|
||||
|
||||
snapshots["test_correctly_fetches_id_name_rebels 1"] = {
|
||||
|
@ -84,9 +85,10 @@ type PageInfo {
|
|||
type Query {
|
||||
rebels: Faction
|
||||
empire: Faction
|
||||
|
||||
node(
|
||||
"""The ID of the object"""
|
||||
node(id: ID!): Node
|
||||
id: ID!
|
||||
): Node
|
||||
}
|
||||
|
||||
"""A ship in the Star Wars saga"""
|
||||
|
|
|
@ -183,15 +183,18 @@ def test_str_schema():
|
|||
|
||||
type RootQuery {
|
||||
first: String
|
||||
|
||||
node(
|
||||
"""The ID of the object"""
|
||||
node(id: ID!): Node
|
||||
|
||||
id: ID!
|
||||
): Node
|
||||
onlyNode(
|
||||
"""The ID of the object"""
|
||||
onlyNode(id: ID!): MyNode
|
||||
|
||||
id: ID!
|
||||
): MyNode
|
||||
onlyNodeLazy(
|
||||
"""The ID of the object"""
|
||||
onlyNodeLazy(id: ID!): MyNode
|
||||
id: ID!
|
||||
): MyNode
|
||||
}
|
||||
'''
|
||||
)
|
||||
|
|
|
@ -78,8 +78,10 @@ def test_str_schema_correct():
|
|||
}
|
||||
|
||||
type RootQuery {
|
||||
node(
|
||||
"""The ID of the object"""
|
||||
node(id: ID!): Node
|
||||
id: ID!
|
||||
): Node
|
||||
}
|
||||
|
||||
type User implements Node {
|
||||
|
|
9
setup.py
9
setup.py
|
@ -59,6 +59,8 @@ tests_require = [
|
|||
"iso8601",
|
||||
]
|
||||
|
||||
dev_requires = ["black==19.3b0", "flake8==3.7.7"] + tests_require
|
||||
|
||||
setup(
|
||||
name="graphene",
|
||||
version=version,
|
||||
|
@ -76,15 +78,16 @@ setup(
|
|||
"Topic :: Software Development :: Libraries",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
],
|
||||
keywords="api graphql protocol rest relay graphene",
|
||||
packages=find_packages(exclude=["tests", "tests.*", "examples"]),
|
||||
install_requires=[
|
||||
"graphql-core>=3.0.0a0,<4",
|
||||
"graphql-relay>=3.0.0a0,<4",
|
||||
"graphql-core>=3.0.0,<4",
|
||||
"graphql-relay>=3.0.0,<4",
|
||||
"aniso8601>=6,<9",
|
||||
],
|
||||
tests_require=tests_require,
|
||||
extras_require={"test": tests_require},
|
||||
extras_require={"test": tests_require, "dev": dev_requires},
|
||||
cmdclass={"test": PyTest},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user