diff --git a/data/insee_data_test.go b/data/insee_data_test.go index 0b3adc6..62798f4 100644 --- a/data/insee_data_test.go +++ b/data/insee_data_test.go @@ -171,3 +171,13 @@ func TestNewInseeData_ValidFrenchCorsica(t *testing.T) { assert.Equal([]string{"FRANCE"}, insee.Countries) assert.Equal(23, insee.ControlKey) } + +var inseeResult *InseeData + +func BenchmarkNewInseeData(b *testing.B) { + var in *InseeData + for i := 0; i < b.N; i++ { + in, _ = NewInseeData("299122A00498723") + } + inseeResult = in +} diff --git a/tasks.py b/tasks.py index 26da3a7..49d1fee 100644 --- a/tasks.py +++ b/tasks.py @@ -25,7 +25,8 @@ BASE_DIR = Path(__file__).parent.resolve(strict=True) def test(context): """Run tests""" context: Context - context.run(f"go test {BASE_DIR}/...", echo=True) + with context.cd(BASE_DIR): + context.run(f"go test ./... -race -bench .", echo=True) @task(pre=[test])