Open bab014 opened 3 months ago
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 https://github.com/ionelmc/pytest-benchmark/issues/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.
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