-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting TypeError: 'NoneType' object is not Callable #258
Comments
You're passing the result (`None`) of of your function instead of passing
the function. Remove those `()`. Eg: `benchmark(csv_ingest)`
…On Fri, Apr 19, 2024, 21:57 Bret Beatty ***@***.***> wrote:
First time user. Followed the instructions, I see that benchmark is an
active plugin but everytime I try and use the benchmark fixture I get that
error.
What am I doing wrong?
import csv
pytest_plugins = ("benchmark",)
def csv_ingest():
with open("./data/customers-2000000.csv") as f:
csv_reader = csv.reader(f)
count: int = 0
for record in csv_reader:
# if count == 1:
# print(record)
new_record = record[0:4]
name = new_record[2].upper()
def raw_ingest():
with open("./data/customers-2000000.csv") as f:
count: int = 0
for line in f:
record = line.split(",")
# if count == 1:
# print(record)
new_record = record[0:4]
name = new_record[2].upper()
def test_csv_ingest(benchmark):
""" Testing speed of initial ingest """
benchmark(csv_ingest())
def test_raw_ingest(benchmark):
""" Testing speed of initial ingest """
benchmark(raw_ingest())
—
Reply to this email directly, view it on GitHub
<#258>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA7TXKR2FHFWAGA3KTPTDDY6FSJ3AVCNFSM6AAAAABGPVQ4JCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TGNZQGUYDSMQ>
.
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Wow, so simple, can't believe I missed it. Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First time user. Followed the instructions, I see that benchmark is an active plugin but everytime I try and use the benchmark fixture I get that error.
What am I doing wrong?
And the full error
The text was updated successfully, but these errors were encountered: