updated singleton with pytests
Updated Singleton pattern with pytests