The luminosity distance describing the effect of local inhomogeneities in the propagation of light proposed by Zeldovich-Kantowski-Dyer-Roeder ( ZKDR ) is tested with two probes for two distinct ranges of redshifts : supernovae Ia ( SNe Ia ) in 0.015 \leq z \leq 1.414 and gamma-ray bursts ( GRBs ) in 1.547 \leq z \leq 3.57 . Our analysis is performed by a Markov Chain Monte Carlo ( MCMC ) code that allows us to constrain the matter density parameter \Omega _ { m } as well as the smoothness parameter \alpha that measures the inhomogeneous-homogeneous rate of the cosmic fluid in a flat \Lambda CDM model . The obtained best fits are ( \Omega _ { m } = 0.285 ^ { +0.019 } _ { -0.018 } , \alpha = 0.856 ^ { +0.106 } _ { -0.176 } ) from SNe Ia and ( \Omega _ { m } = 0.259 ^ { +0.028 } _ { -0.028 } , \alpha = 0.587 ^ { +0.201 } _ { -0.202 } ) from GRBs , while from the joint analysis the best fits are ( \Omega _ { m } = 0.284 ^ { +0.021 } _ { -0.020 } , \alpha = 0.685 ^ { +0.164 } _ { -0.171 } ) with a \chi ^ { 2 } _ { red } = 0.975 . The value of the smoothness parameter \alpha indicates a clumped universe however it does not have an impact on the amount of dark energy ( cosmological constant ) needed to fit observations . This result may be an indication that the Dyer-Roeder approximation does not describe in a precise form the effects of clumpiness in the expansion of the universe .