Tag:test method

  • How to implement parameterized testing in Python?

    Time:2020-4-24

    Before that, I turned to a series of articles on unit testing framework, which introduced unittest, nose / nose2 and pytest, the three most popular Python testing frameworks. In this paper, we want to continue to talk about the topic of testing for a very common test scenario, namely parametric testing, and try to connect […]

  • Retry retry mechanism

    Time:2020-2-22

    There are two retry mechanisms: guava and spring. Guava retryer tool POM reference <dependency> <groupId>com.github.rholder</groupId> <artifactId>guava-retrying</artifactId> <version>2.0.0</version> </dependency> test method Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfExceptionOfType(Exception.class) //Return false also need to retry .retryIfResult(Predicates.equalTo(false)) //Readjustment strategy .withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS)) //Number of attempts .withStopStrategy(StopStrategies.stopAfterAttempt(3)) .build(); try { //Executes the specified method. retryer.call(() -> { System.err.println(“do something…”); Throw new exception […]

  • . net best practices – learning notes

    Time:2020-2-13

    . net best practices ========== ========== ==========Stephen Ritchie(c) Huang Dengqiao, Huang Haoyu, Li Yong[publication] Mechanical Industry Press[edition] January 2014 Edition 1[printing time] first printing in January 2014[price] 69.00 yuan========== ========== ========== (P001) Developers should be skeptical of any practice they call “best practice.”. Developers should choose which “best practices” to adopt based on their specific […]

  • Python advanced source code analysis: how to change a class method into multiple methods?

    Time:2020-2-5

    The previous article, “how to implement parametric testing in Python?”? 》In, I mentioned several libraries for implementing parameterized tests in Python, and left a problem: How do they turn a method into multiple methods and bind each method with corresponding parameters? Let’s refine again. The original question is:In a class, how to use decorators to […]