我可以在套件中运行一个测试吗? [英] Can I run a single test in a suite?

查看:49
本文介绍了我可以在套件中运行一个测试吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的结构设置了一个测试套件( https://github.com/stretchr/testify#suite-package ).通过只指定一个模式就可以运行单个测试之前:

I have setup a test suite for my struct (https://github.com/stretchr/testify#suite-package). Before I was able to run a single test by specifying just a pattern:

go test -v ./services/gateways/... -run mytest

此方法在转换后不起作用.运气不好还是有办法吗?

This approach doesn't work after conversion. Bad luck or is there a way?

推荐答案

您可以通过指定 -testify.m 参数来运行单个方法.

You can run single methods by specifying the -testify.m argument.

运行此套件方法命令是:

开始测试-v github.com/vektra/mockery/mockery -run ^ TestGeneratorSuite $ -testify.m TestGenerator

这篇关于我可以在套件中运行一个测试吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆